<template>
    <div>
        <van-tabs v-model:active="active">
            <van-tab title="标签 1">
                <van-swipe :autoplay="3000" lazy-render>
                    <van-swipe-item v-for="image in list" :key="image">
                        <img :src="image.image_src" style="width: 100%;" />
                    </van-swipe-item>
                </van-swipe>

                <van-grid :border="false" :column-num="2">
                    <van-grid-item v-for="(v,i) in user">
                        <van-image :src="v.goods_big_logo" />
                        <p>{{ v.goods_name }}</p>
                        <p style="color:#ff5f16;">价格{{ v.goods_price }}</p>
                    </van-grid-item>
                    
                    
                </van-grid>
            </van-tab>
            <van-tab title="标签 2">内容 2</van-tab>
            <van-tab title="标签 3">内容 3</van-tab>
            <van-tab title="标签 4">内容 4</van-tab>
        </van-tabs>
    </div>
</template>

<script setup>
import { ref } from 'vue';
const active = ref(0);
import { swiperdataApi, catitemsApi,searchApi } from '@/api/api';
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
];
let list = ref("")
const getlist = () => {
    swiperdataApi().then(res => {
        list.value = res.data.message
    })
}
getlist()

let user = ref("")
const catlist = () => {
    searchApi().then(res => {
        user.value = res.data.message.goods
    })
}
catlist()
</script>

<style lang="scss" scoped></style>
https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg